﻿using HiStore.Configuration.Heleper;
using System;

namespace HiStore.Configuration
{
    public class AppSettingsConstVars
    {
        #region 数据库主库================================================================================
        /// <summary>
        /// 获取数据库连接字符串
        /// </summary>
        public static readonly string DbSqlConnection = AppSettingsHelper.GetContent("ConnectionStrings", "SqlConnection");
        /// <summary>
        /// 获取数据库类型
        /// </summary>
        public static readonly string DbDbType = AppSettingsHelper.GetContent("ConnectionStrings", "DbType");

        /// <summary>
        /// 获取数据库超时时间
        /// </summary>
        public static readonly int DBCommandTimeout =int.Parse(AppSettingsHelper.GetContent("ConnectionStrings", "DBCommandTimeout"));
        #endregion

        #region 数据库从库1===========================================================================
        /// <summary>
        /// 权重1
        /// </summary>
        public static readonly int SlaveHitRate1 = int.Parse(AppSettingsHelper.GetContent("ConnectionStrings", "SlaveHitRate1"));
        /// <summary>
        /// 获取数据库连接字符串
        /// </summary>
        public static readonly string DbSqlConnection1 = AppSettingsHelper.GetContent("ConnectionStrings", "SlaveSqlConnectio1");
        #endregion

        #region 数据库从库2===========================================================================
        /// <summary>
        /// 权重2
        /// </summary>
        public static readonly int SlaveHitRate2 = int.Parse(AppSettingsHelper.GetContent("ConnectionStrings", "SlaveHitRate2"));
        /// <summary>
        /// 获取数据库连接字符串
        /// </summary>
        public static readonly string DbSqlConnection2 = AppSettingsHelper.GetContent("ConnectionStrings", "SlaveSqlConnectio2");
        #endregion

        #region redis链接
        public static readonly string RedisConfigConnectionString= AppSettingsHelper.GetContent("ConnectionStrings", "RedisConfig");
        #endregion
    }
}
